unit cpf_cnpj;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons;

type
  TFormCPF = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    BitBtn1: TBitBtn;
    procedure BitBtn1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormCPF: TFormCPF;

implementation

uses principal;

{$R *.dfm}

procedure TFormCPF.BitBtn1Click(Sender: TObject);
begin
        FormPrincipal.CPF_CNPJ:=Edit1.Text;
        FormPrincipal.NomeConsumidor:=Edit2.Text;
        FOrmPrincipal.EnderecoConsumidor:=Edit3.Text;
        Close;
end;

procedure TFormCPF.FormShow(Sender: TObject);
begin
        if Height=105 then  begin
                label2.visible:=false; edit2.visible:=false;
                label3.visible:=false; edit3.visible:=false;
        end
        else begin
                label2.visible:=true; edit2.visible:=true;
                label3.visible:=true; edit3.visible:=true;
        end;

end;

end.
